import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

//发送网络请求 配置axios
import axios from 'axios'
axios.defaults.baseURL = 'http://127.0.0.1:8000'
// 请求携带cookie
axios.defaults.withCredentials = true
// 异步请求 不阻塞 --请求头
axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest'
// 获取本地 token  没有则为空
axios.defaults.headers['token'] = localStorage.getItem('token')||""
//内容类型
axios.defaults.headers.post['Content-Type'] = 'application/json'

Vue.prototype.$axios = axios



Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: function (h) { return h(App) }
}).$mount('#app')
